import { createStore } from 'vuex'

export default createStore({
  state() {
    return {
      userInfo: {
        id: '',
        lastname: '',
        departmentid: '',
      },
      currentDepartmentInfo: {}
    }
  },
  getters: {
    getUserInfo(state) {
      return state.userInfo
    }
  },
  mutations: {
    setUserInfo(state, { id, lastname, departmentid }) {
      state.userInfo.id = id
      state.userInfo.lastname = lastname
      state.userInfo.departmentid = departmentid
    },
    setCurrentDepartmentInfo(state, departmentInfo) {
      state.currentDepartmentInfo = departmentInfo
    }
  },
  actions: {
  },
  modules: {
  }
})
